{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
<style>
    #des, #des input {
        width: 40px;
        text-align: center;
    }

    #id {
        width: 78px;
    }

    .bs-checkbox {
        width: 36px;
        height: 40px
    }

    .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
        margin-left: 0;
        margin-top: 0
    }

    #title span {
        float: right;
    }

    .asdlkjasd {
        background: #1ab394;
        color: #fff
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content {:config('adminClass.main')}">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            {include file="public/topsection"}
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div style="display:block;clear: both;"></div>
                    <div class="fixed-table-toolbar">
                        <form method="get" action="">
                            <div class="search">
                                <div class="columns columns-right btn-group pull-left">
                                    <select class="form-control" name="type">
                                        <option value="user_id" {php}if(input(
                                        '?param.type')){if(input('param.type')=='user_id'){echo "selected";}
                                        }{/php}>会员ID</option>
                                        <option value="request_url" {php}if(input(
                                        '?param.type')){if(input('param.type')=='request_url'){echo "selected";}
                                        }{/php}>请求地址</option>
                                    </select>
                                </div>



                                <div class="pull-left search">
                                    <input class="form-control input-outline" type="text"
                                           {php}
                                           if(input('?param.name')){
                                    if(input('param.name')){
                                    echo "value='".input('name')."'";
                                    }

                                    }
                                    {/php}
                                    name="name" placeholder="搜索会员">
                                </div>
                                <div class="pull-left search">
                                    <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px"
                                            class="btn btn-default btn-outline" type="submit">搜索
                                    </button>
                                </div>
                                {php}
                                if(input('?param.name')){
                                {/php}
                                <div class="pull-left search">
                                    <a class="btn btn-w-m btn-link" href="{:url('userlog')}">返回列表</a>
                                </div>
                                {php}
                                }
                                {/php}

                                <div style="display: flex;">
                                    <input name="start" type="text" id="start" class="form-control layui-input" value="{present name='start'}{$start}{/present}" placeholder=" # 起始时间" autocomplete="off" style="height:34px;width:180px;margin:0 10px;">
                                    <input name="end" type="text" id="end" class="form-control layui-input" value="{present name='end'}{$end}{/present}" placeholder=" # 结束时间" autocomplete="off" style="height:34px;width:180px;margin:0 10px;">
                                </div>

                            </div>
                        </form>
                    </div>
                    <div class="example">
                        <form class="form-horizontal" method="post">
                            <table data-toggle="table">
                                <thead>
                                <tr>
                                    <th data-align="center">ID</th>
                                    <th data-align="center">用户</th>
                                    <th data-align="center">请求地址</th>
                                    <th data-align="center">请求参数</th>
                                    <th data-align="center">IP</th>
                                    <th data-align="center">请求方式</th>
                                    <th data-align="center">时间</th>
                                </tr>
                                </thead>
                                <tbody id="form">
                                {volist name="data" id="v"}
                                <tr id="id{$v.id}" class="class">
                                    <td>{$v.id}</td>
                                    <td>{neq name="$v.user_id" value="0"}<a onclick="member('{$v.user_id}')" style="color:#40BCF7">{$v.user_id}</a>{/neq}</td>
                                    <td>{$v.request_url}</td>
                                    <td><div style="max-width:400px;word-break: break-all;">{$v.request_param}</div></td>
                                    <td>{$v.request_ip}</td>
                                    <td>{$v.request_method}</td>
                                    <td>{$v.time|date="Y-m-d H:i:s",###}</td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
{load href="__PLUGINS__iCheck/icheck.min.js"}
{load href="__PLUGINS__iCheck/custom.css"}

<script type="text/javascript">
    function del(id) {
        swal_del(id, "{:url('del')}")
    }

    function member(id)
    {
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.open({
                title :'预览',
                area: ['100%', '100%'],
                type: 2,
                content: '{:url("index")}?search=id&name='+id
            });
        });
    }
    layui.use(['laydate'], function(){
        var laydate = layui.laydate;

        laydate.render({
            elem: '#start' //指定元素
            ,type: 'datetime'
            ,trigger: 'click'
        });

        laydate.render({
            elem: '#end' //指定元素
            ,type: 'datetime'
            ,trigger: 'click'
        });
    })
</script>
 